1. Field of the Invention
The present invention relates to an apparatus for automatically inspecting an object such as a bottle which is transported by a conveyor or the like by utilizing image processing, and more particularly to an automatic inspecting apparatus having a function for generating a discharge signal for discharging a defective object at a predetermined position.
2. Description of the Prior Art
There has been an automatic inspecting apparatus for inspecting objects such as containers which are transported by a conveyor or other transporting equipment. This type of automatic inspecting apparatus comprises a video camera for imaging the moving object, a sensor for detecting the arrival of the object and outputting a detection signal, an image processing unit triggered by the detection signal outputted from the sensor to prowess images produced by the video camera and detect defective objects (products), and a discharge signal generating unit for generating a signal for discharging a defective object at a predetermined position.
In this case, the image processing is performed using only hardware such as logic circuits, and all the hardware in the image processing apparatus can be synchronized at a predetermined video rate, such as {fraction (1/60)} seconds. Images of the objects are processed for a fixed interval after the images are produced, and the processing is completed in the same order in which the objects arrive at the sensor.
As a result, t he position of the objects at the time when image processing is completed is always fixed. Therefore, the number of pulses corresponding to the distance between this fixed position and the position where defective objects are discharged is also fixed for each of the objects. In the case where an object is determined to be defective, the image processing unit generates a reject signal. This reject signal is shifted by the number of pulses corresponding to the above-mentioned distance to thus generate a discharge signal. Then, a rejecting apparatus is actuated for thereby discharging the defective object at a predetermined position.
As CPU processing speed increases and memory capacities increase in recent years, it has become possible to process images in the automatic inspecting apparatus using software. Although software can perform complex image processing that cannot be performed in hardware alone, the processing time varies according to the condition of the image. As a result, the order in which image processing is completed for objects differs from the order in which the objects arrive at the sensor. Hence, the positions of the objects at the time when image processing is completed are not fixed. Accordingly, a new apparatus is required for discharging defective objects at the fixed discharge position.
In view of the foregoing, it is therefore an object of the present invention to provide an automatic inspecting apparatus which can image moving objects, process the images to determine whether the objects are defective, and discharge the defective object at a predetermined position even when the processing time differs for each image.
In order to achieve the above object, according to the present invention, there is provided an automatic inspecting apparatus by image processing, comprising: an imaging device for imaging the object which is moved by a moving device having an encorder; a sensor for detecting the arrival of the object and outputting a detection signal; an image processing unit that is triggered by the signal outputted from the sensor to process images produced by the imaging device to detect defective objects; and a discharge signal generating unit for discharging defective objects at a predetermined position; wherein an ID number is assigned to each image produced by the imaging device, pulses generated by the encoder starts to be counted when each ID number is assigned, and if an object is determined to be defective after image processing by the image processing unit, the discharge signal generating unit generates a discharge signal when the number of pulses counted for the corresponding ID number reaches a pulse number equivalent to the distance between the sensor position and the discharge position.
According to the present invention, objects are assigned an ID number, and the number of pulses corresponding to the distance between the sensor position and the discharge position are counted. If an object is determined to be defective by the image processing unit, when the number of pulses counted reaches the number of pulses corresponding to the distance between the sensor position and the discharge position, a discharge signal is generated and the defective object is discharged from a transportation line such as a conveyor.